package com.example.study_thread.c_thread;

public class Test01 {
    public static void main(String[] args) throws InterruptedException {
        Mythread1 t1 = new Mythread1();
        t1.setName("金莲");

//        Mythread2 t2 = new Mythread2();
//        t2.setName("西门庆");

//        将t2为守护线程
//        t2.setDaemon(true);

        t1.start();
//        t2.start();
//        将t1插入到主线程之前
        t1.join();

        for (int i = 0; i < 10; i++) {
            System.out.println("main方法中" + Thread.currentThread().getName() + "执行了....." + i);
        }
    }
}
